//
//  InformationTableViewCell.m
//  WeiDuKeJi
//
//  Created by 谷银行 on 2019/1/28.
//  Copyright © 2019 谷银行. All rights reserved.
//

#import "InformationTableViewCell.h"

@implementation InformationTableViewCell
- (UIImageView *)imgV{
    if (!_imgV) {
        _imgV = [[UIImageView alloc]init];
    }
    return _imgV;
}
- (UILabel *)TitleLabel{
    if (!_TitleLabel) {
        _TitleLabel = [[UILabel alloc]init];
        _TitleLabel.font = [UIFont systemFontOfSize:14];
    }
    return _TitleLabel;
}
- (UILabel *)contentLabel{
    if (!_contentLabel) {
        _contentLabel = [[UILabel alloc]init];
        _contentLabel.numberOfLines = 0;
        _contentLabel.font = [UIFont systemFontOfSize:12];
        _contentLabel.textColor = [UIColor lightGrayColor];
    }
    return _contentLabel;
}
- (UILabel *)timeLabel{
    if (!_timeLabel) {
        _timeLabel = [[UILabel alloc]init];
        _timeLabel.font = [UIFont systemFontOfSize:12];
        _timeLabel.textColor = [UIColor lightGrayColor];
    }
    return _timeLabel;
}
- (UIButton *)praiseBtn{
    if (!_praiseBtn) {
        _praiseBtn = [[UIButton alloc]init];
    }
    return _praiseBtn;
}
- (UILabel *)praiseLabel{
    if (!_praiseLabel) {
        _praiseLabel = [[UILabel alloc]init];
    }
    return _praiseLabel;
}
- (UIButton *)shareBtn{
    if (!_shareBtn) {
        _shareBtn = [[UIButton alloc]init];
    }
    return _shareBtn;
}
- (UILabel *)shareLabel{
    if (!_shareLabel) {
        _shareLabel = [[UILabel alloc]init];
    }
    return _shareLabel;
}
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self=[super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self addSubview:self.imgV];
        [self addSubview:self.TitleLabel];
        [self addSubview:self.contentLabel];
        [self addSubview:self.timeLabel];
        [self addSubview:self.praiseBtn];
        [self addSubview:self.praiseLabel];
        [self addSubview:self.shareBtn];
        [self addSubview:self.shareLabel];
        [self information];
    }
    return self;
}
- (void)information{
    
    // 图片
    _imgV.sd_layout
    .topSpaceToView(self, 10)
    .leftSpaceToView(self, 12)
    .widthIs(160)
    .heightIs(110);
    
    // 标题
    _TitleLabel.sd_layout
    .topSpaceToView(self, 5)
    .leftSpaceToView(_imgV, 10)
    .heightIs(30)
    .widthIs(220);
    
    // 内容
    _contentLabel.sd_layout
    .topSpaceToView(_TitleLabel, 0)
    .leftSpaceToView(_imgV, 10)
    .widthIs(220)
    .heightIs(40);
    
    // 发送时间
    _timeLabel.sd_layout
    .topSpaceToView(_contentLabel, 5)
    .leftSpaceToView(_imgV,10)
    .widthIs(80)
    .heightIs(30);
    
    // 点赞按钮
    _praiseBtn.sd_layout
    .topSpaceToView(_contentLabel, 10)
    .leftSpaceToView(_timeLabel, 20)
    .widthIs(20)
    .heightIs(20);
    
    // 点赞个数
    _praiseLabel.sd_layout
    .topSpaceToView(_contentLabel, 10)
    .leftSpaceToView(_praiseBtn, 10)
    .widthIs(50)
    .heightIs(20);
    
    //分享按钮
    _shareBtn.sd_layout
    .topSpaceToView(_contentLabel, 10)
    .leftSpaceToView(_praiseLabel, 10)
    .widthIs(20)
    .heightIs(20);
    //分享个数
    _shareLabel.sd_layout
    .topSpaceToView(_contentLabel, 10)
    .leftSpaceToView(_shareBtn, 0)
    .heightIs(20)
    .widthIs(50);
}

@end
